<include file="Public:header" />
<!--添加文章-->
<form id="info_form" action="{:U('User/add')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">会员信息</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
					<tr>
						<th width="120">选择分类 :</th>
						<td>
                            <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('UserCate/ajax_getchilds')}" data-selected=""></select>
                            <input type="hidden" name="info[cate_id]" id="J_cate_id" value="" />
                        </td>
					</tr>
		            <tr>
						<th>用户名 :</th>
						<td>
							<input type="text" name="username" id="username" class="input-text" size="20">
                        </td>
					</tr>
                    <tr>
                        <th>email :</th>
                        <td><input type="text" name="email" id="email" class="input-text" size="20"></td>
                    </tr>
                    <tr>
                        <th>手机号 :</th>
                        <td><input type="text" name="info[mobile]" class="input-text" size="20"></td>
                    </tr>
                     <tr>
						<th>密码:</th>
						<td><input type="password" name="password" id="password" class="input-text"  size="20" /></td>
		 			</tr>
                    <tr>
                        <th>真实姓名 :</th>
                        <td><input type="text" name="info[true_name]" class="input-text" size="20"></td>
                    </tr>
                    <tr>
                        <th>qq :</th>
                        <td><input type="text" name="info[qq]" class="input-text" size="20"></td>
                    </tr>
                    <tr>
                        <th>性别 :</th>
                        <td>
                            <label><input type="radio" name="info[sex]" class="radio_style" value="1" checked="checked"> 男 </label>&nbsp;&nbsp;
                            <label><input type="radio" name="info[sex]" class="radio_style" value="2" > 女</label>
                        </td>
                    </tr>
                    <tr>
                        <th>个人主页 :</th>
                        <td><input type="text" name="info[website]" class="input-text" size="30"></td>
                    </tr>
                    <tr>
                        <th>生日 :</th>
                        <td><input type="text" name="info[birthday]" class="input-text" size="20"> 2014-01-22</td>
                    </tr>
                    <tr>
                        <th>联系地址 :</th>
                        <td><input type="text" name="info[address]" class="input-text" size="30"></td>
                    </tr>

				</table>
            </div>
        </div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<include file="Public:footer" />
<script>
    $('.J_cate_select').cate_select('请选择');

</script>
<script src="__STATIC__/js/formvalidator.js"></script>
<script>
    $(function(){
        var check_name_url = '{:U("User/checkusername")}';
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_cate_id").formValidator({onshow:"请选择分类",onfocus:"请选择分类"}).regexValidator({regexp:"intege1",datatype:"enum",onerror:"请选择分类"});
        $("#username").formValidator({onshow:'请填写用户名',onfocus:'用户名应由3-16个字母或数字组成'}).inputValidator({min:3,onerror:'至少为3个字符'}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"用户名格式不正确"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "该用户名已被注册",
            onwait : "正在验证..."
        });
        $("#password").formValidator({onshow:'请填写密码',onfocus:'密码由6-16位字线或数字组成'}).inputValidator({min:3,onerror:'至少为6个字符'});
        $("#email").formValidator({onshow:"请输入邮箱",onfocus:"邮箱格式错误",oncorrect:"邮箱格式正确"}).inputValidator({min:2,max:32,onerror:"邮箱应该为2-32位之间"}).regexValidator({regexp:"email",datatype:"enum",onerror:"邮箱格式错误"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(data){
                if( data.status == "1" ) {
                    return true;
                } else {
                    return false;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "禁止注册或邮箱已存在",
            onwait : "正在验证..."
        });

    });

</script>
</body>
</html>